	<div class="overview"  style="width:45%;float:right">
        <div class="dashboard-heading">Thanh Toán</div>
        <div class="dashboard-content" style="min-height:initial;padding:5px;font-weight:bold">
          <table class="list" style="margin-bottom:0">
          <tbody>
		   <thead>
				<tr>
				   <td class="right">Tổng thanh toán</td> 
				    <td class="right"><?php echo $total;?>
						<input name="total" value="<?php echo $total1;?>" type="hidden"/>
					</td>
					<td align="right"><a class="button" id="button-transaction">Thanh Toán</a></td>
				</tr>
				<tr>
				   <td class="right">Ghi chú: </td> 
				    <td class="right"><textarea rows="5" cols="40" name="comment"></textarea></td>
				</tr>
			  </thead>
          </tbody>
        </table>
		
        </div>
      </div>
	  <div style="clear:both"></div>
	<table class="list">
          <thead>
		  <p style="font-weight:bold;font-size: 16px;">I. Hoa hồng tổng cộng: </p>
            <tr>
              <td class="center">Họ tên</td>  
			  <td class="center">Mã thành viên</td>
              <td class="center">Tổng HH trực tiếp</td>
			  <td class="center">Tổng HH gián tiếp	</td>
			  <td class="center">Tổng cộng</td>	
            </tr>
          </thead>
         <tbody>
		  <tr>
			  <td class="center"><?php echo $name; ?></td>
              <td class="center"><?php echo $madn; ?></td>
              <td class="center"><?php echo $totalbaotro; ?></td>
			  <td class="center"><?php echo $totaltuvan; ?></td>
			  <td class="center"><?php echo $total ; ?></td>
			  </tr>
         </tbody>
       </table>

		<table class="list">
          <thead>
		  <p style="font-weight:bold;font-size: 16px;">II. Chi tiết hoa hồng trực tiếp:</p>
            <tr>
              <td class="center">STT</td>  
              <td class="center">Mã phát</td>  
			  <td class="center">Họ tên phát</td>
			  <td class="center">Điện thoại</td>
			   <td class="center">Email</td>		
              <td class="center">Ngày phát</td>
			<td class="center">Tiền hoa hồng</td>
            </tr>
          </thead>
         <tbody>
		  <?php if ($hhbaotro) { $i = Count($hhbaotro); ?>
            <?php foreach ($hhbaotro as $customer) { ?>
			<tr>	
               <td class="center"><?php echo $i; ?></td>
			   <td class="center"><?php echo $customer['madn']; ?></td>
			   <td class="center"><?php echo $customer['name']; ?></td>
               <td class="center"><?php echo $customer['telephone']; ?></td>
			   <td class="center"><?php echo $customer['email']; ?></td>
               <td class="center"><?php echo $customer['date_added']; ?></td>
			   <td class="center"><?php echo $customer['hoahong']; ?></td>
            </tr>
            <?php $i--; } ?>
            <?php } else { ?>
            <tr>
              <td class="center" colspan="7"></td>
            </tr>
            <?php } ?>
          </tbody>
        </table>
		
		<table class="list">
          <thead>
		  <p style="font-weight:bold;font-size: 16px;">III. Chi tiết hoa hồng gián tiếp:</p>
            <tr>
              <td class="center">STT</td>  
              <td class="center">Mã phát</td>  
			  <td class="center">Họ tên phát</td>
			  <td class="center">Điện thoại</td>
			  <td class="center">Email</td>
              <td class="center">Ngày phát</td>
			  <td class="center">Tiền hoa hồng</td>
            </tr>
          </thead>
         <tbody>
		  <?php if ($hhtuvan) { $i = Count($hhtuvan); ?>
			
            <?php foreach ($hhtuvan as $customer) { ?>
			<tr>
				<td class="center"><?php echo $i; ?></td>
				<td class="center"><?php echo $customer['madn']; ?></td>
				<td class="center"><?php echo $customer['name']; ?></td>
				<td class="center"><?php echo $customer['telephone']; ?></td>
				<td class="center"><?php echo $customer['email']; ?></td>
				<td class="center"><?php echo $customer['date_added']; ?></td>
				<td class="center"><?php echo $customer['hoahong']; ?></td>
            </tr>
            <?php $i--; } ?>
            <?php } else { ?>
            <tr>
              <td class="center" colspan="7"></td>
            </tr>
            <?php } ?>
          </tbody>
        </table>